Carbon


FSpCatMove

Header: Files.h Carbon status: Supported

Moves a file or directory from one location to another on the same volume.

OSErr FSpCatMove (
    const FSSpec *source, 
    const FSSpec *dest
);
source

A pointer to an FSSpec structure specifying the name and location of the file or directory to be moved.

dest

A pointer to an FSSpec structure specifying the name and location of the directory into which the source file or directory is to be moved. The directory ID specified in the parID field of the dest parameter is the directory ID of the parent of the directory into which you want to move the source file or directory. The name field of the dest parameter specifies the name of the directory into which you want to move the source file or directory.

function result

A result code.

DISCUSSION

If you don’t already know the parent directory ID of the destination directory, it might be easier to use the PBCatMoveSync or PBCatMoveAsync function, which allow you to specify only the directory ID of the destination directory.

The FSpCatMove function is strictly a file catalog operation; it does not actually change the location of the file or directory on the disk. You cannot use FSpCatMove to move a file or directory to another volume (that is, the vRefNum field in both FSSpec parameters must be the same). Also, you cannot use FSpCatMove to rename files or directories; to rename a file or directory, use FSpRename.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)